package cn.coco.jf.fw.api.config.consts;

import com.jfinal.kit.Prop;
import com.jfinal.kit.PropKit;



public class SysConfigConst {
    public static Prop sysConfig = PropKit.use("sysConfig.properties");

    // ======MYSQL STA======
    public static String DB_URL = sysConfig.get("db.url");
    public static String DB_USERNAME = sysConfig.get("db.username");
    public static String DB_PASSWD = sysConfig.get("db.passwd");
    public static String DB_DRIVER = sysConfig.get("db.driver", "com.mysql.jdbc.Driver");
    
    public static int DB_INITIALSIZE = sysConfig.getInt("db.initialSize", 10);
    public static int DB_MINIDLE = sysConfig.getInt("db.minIdle",5);
    public static int DB_MAXACTIVE = sysConfig.getInt("db.maxActive", 20);
    // ======MYSQL END======
    
    // ======ORACLE STA======
    public static String DB_URL_ORACLE = sysConfig.get("db.url.oracle");
    public static String DB_USERNAME_ORACLE = sysConfig.get("db.username.oracle");
    public static String DB_PASSWD_ORACLE = sysConfig.get("db.passwd.oracle");
    public static String DB_DRIVER_ORACLE = sysConfig.get("db.driver.oracle", "oracle.jdbc.OracleDriver");
    
    public static int DB_INITIALSIZE_ORACLE = sysConfig.getInt("db.initialSize.oracle", 10);
    public static int DB_MINIDLE_ORACLE = sysConfig.getInt("db.minIdle.oracle",5);
    public static int DB_MAXACTIVE_ORACLE = sysConfig.getInt("db.maxActive.oracle", 20);
    // ======ORACLE END======
    
    // ======Redis支持======
    public static boolean REDIS_ENABLE=sysConfig.getBoolean("redis.enable", false);
    // 逗号分隔
    public static String REDIS_MODULE=sysConfig.get("redis.module", "redis_coco");
    // Redis服务器
    public static String REDIS_SERVER_IP = sysConfig.get("redis.server.ip", "127.0.0.1");
    public static int REDIS_SERVER_PORT = sysConfig.getInt("redis.server.port", 6379);

    public static boolean CONFIG_DEV_MODE = sysConfig.getBoolean("config_dev_mode", true);

    // 自定义的环境配置文件路径
    public static String SYS_OS_ENV_CONFIG_FILE_PATH = sysConfig.get("sys.os.env.config.filepath");

}
